home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / awebums.lha / awebmailtoums.rexx < prev   
OS/2 REXX Batch file  |  1996-05-07  |  2KB  |  76 lines

  1. /* $VER: awebmailtoums.rexx 0.22 (07.05.96)       */
  2. /* by Lothar Bartsch (lbartsch@anjou.hb.provi.de) */
  3. /*                                                */
  4. /* This script use mailto: with AWeb and UMS      */
  5. /*                                                */
  6. /* Usage:                                         */
  7. /* Select AWeb - Change Settings -                */
  8. /*        Network 3: External programs            */
  9. /* Insert at mailto:                              */
  10. /*        Command   sys:rexxc/rx                  */
  11. /*      Arguments   awebmailtoums.rexx %s         */
  12. /*                                                */
  13. /* Change name,password and server in this skript */
  14.  
  15. /* Insert your configs here */
  16. name = ""
  17. password = ""
  18. server = ""
  19. editor = "ed sticky"
  20.  
  21.  
  22. parse arg user '@' addr .
  23. options results
  24.  
  25. CALL AddLib("rexxsupport.library", 0, -30, 0)
  26. CALL AddLib("rexxreqtools.library", 0, -30, 0)
  27. CALL AddLib("ums.library", 0, -210, 11)
  28. CALL UMSInitConsts()
  29.  
  30. p=show('P',,)
  31. if(pos('AWEB.', p) > 0) then awebport = word(substr(p, pos('AWEB.', p)), 1)
  32.  
  33. address (awebport)
  34.  
  35. 'get url'
  36. url = result
  37. 'get title'
  38. title = result
  39.  
  40. subj = rtgetstring(title,"Insert a subject for this message:","AWebMailtoUMS")
  41. IF rtresult = 0 THEN EXIT
  42.  
  43. msgfile = 't:.temp.'Pragma(ID)
  44.  
  45. SHELL command editor msgfile
  46. IF ~EXISTS(msgfile) THEN EXIT
  47.  
  48. /* Login */
  49.  
  50. account = UMSLogin(name,password,server)
  51. IF account = 0 THEN DO
  52.   EXIT 10
  53. END
  54.  
  55. /* Write the message */
  56.  
  57. DROP msg.
  58. msg.UMSCODE_MsgText_FILE = msgfile
  59. msg.UMSCODE_ToAddr       = user'@'addr
  60. msg.UMSCODE_ToName       = user
  61. msg.UMSCODE_Subject      = subj
  62. msg.UMSCODE_RfcAttr      = '"X-Url: '||url||'"'
  63.  
  64. num = UMSWriteMsg(account, msg.)
  65.  
  66. /* Logout */
  67.  
  68. IF account ~= 0 THEN DO
  69.   CALL UMSLogout(account)
  70.   account = 0
  71. END
  72.  
  73. call delete(msgfile)
  74.  
  75. EXIT
  76.